# serializers.py in 'alerts' app
from rest_framework import serializers
from .models import alert

class AlertSerializer(serializers.ModelSerializer):
    class Meta:
        model = alert
        fields = ['alert_id', 'alert_type', 'trigger_time', 'device', 'level']
